1. Field of the Invention
Embodiments of the present invention relate to processors and microprocessors. More specifically, embodiments of the present invention relate to registers used by processors and microprocessors.
2. Related Art
Innovations in processor design have yielded processors (or microprocessors) that consume less power and operate at cooler temperatures in comparison to other types of processors (or microprocessors). These improved processors accomplish this in part by transferring some processor functions to software. More specifically, processor functions keyed to determining what instructions (micro-instructions) to execute, and when, are transferred to software in a process that may be referred to as “code morphing™” or “translation.” Using code morphing™ or translation software “non-native” instructions (e.g., conventional x86 or 80x86 instructions) are translated into “native” instruction sets that can be used by the improved processors. Non-native instructions are also referred to as target instructions, and native instructions are also referred to as host instructions. Translated instructions are demarcated by “commit points,” which are points in the translation where a host processor state and a target processor state would be consistently represented in the host processor.
In a code morphing™ or translation-based system, the program counter (PC) or instruction pointer (IP) of the target instruction is not maintained explicitly. In some implementations, the program counter value associated with a commit point (referred to herein as the “at-commit” or “after-commit” program counter, or ACPC) is stored in a register. The ACPC can sometimes be used to reconstruct the PC or IP of the target instruction.
However, there are instances in which there is a mapping of multiple PCs or IPs to a single ACPC value. In these instances, the ACPC cannot be used to reconstruct a particular PC or IP. Accordingly, a method and/or system that can be used to recover the PC or IP of a target instruction would be of value.